package org.xx.armory.doc;

/**
 * 换页符对象。
 *
 * <p>换页符是个块级对象，但是不包含任何子元素。</p>
 */
public final class PageBreaker
        extends Block {
    private final boolean landscape;

    /**
     * 构造文档元素实例。
     *
     * @param landscape
     *         是否横向。
     */
    public PageBreaker(
            boolean landscape
    ) {
        super("");

        this.landscape = landscape;
    }

    public final boolean isLandscape() {
        return this.landscape;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public final String toString() {
        return "<page-breaker " + (landscape ? "landscape" : "") + " />";
    }
}
